﻿# CMakeList.txt: cpp_demo 的 CMake 项目，在此处包括源代码并定义
# 项目特定的逻辑。
#
cmake_minimum_required (VERSION 3.8)

project ("cpp_demo")

# 将源代码添加到此项目的可执行文件。
add_executable (cpp_demo "cpp_demo.cpp" "cpp_demo.h")

set(keyword "MYSQL_VERSION_MINOR")

FILE (STRINGS ./VERSION str)
message(STATUS "0. version file:${str}")
FILE (STRINGS ./VERSION str REGEX "^[ ]*${keyword}=")
message(STATUS "1. change version file to [${str}]")
IF(str)
    STRING(REPLACE "${keyword}=" "" str ${str})
    message(STATUS "2. change version file to [${str}]")
    STRING(REGEX REPLACE  "[ ].*" ""  str "${str}")
    message(STATUS "3. change version file to [${str}]")
ENDIF()

# TODO: 如有需要，请添加测试并安装目标。
